#ifndef CAMVIEW_H
#define CAMVIEW_H

#include <QtWidgets>
#include <QPainter>
#include <QFont>
#include <QMutex>

#include "receiver.h"
#include "detector.h"

class CamView : public QWidget,
                public Receiver
{
public:
    CamView();
    ~CamView();

    void setDetector(Detector*);
    void newFrame(const cv::Mat&);
    static QImage Mat2QImage(const cv::Mat&);

protected:
    void paintEvent(QPaintEvent *);

private:
    Detector* detector;
    cv::Mat frame;
	QMutex mutex;
};

#endif // CAMVIEW_H
